package com.niit.entity;

import com.niit.entity.embeddable.NotificationReadId;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Entity
@Table(name = "notification_read")
@NoArgsConstructor
@AllArgsConstructor
public class NotificationRead {
    @EmbeddedId
    private NotificationReadId id;

    @ManyToOne
    @MapsId("notificationId")
    @JoinColumn(name = "notification_id")
    private Notification notification;

    @ManyToOne
    @MapsId("userId")
    @JoinColumn(name = "user_id")
    private User user;

    private LocalDateTime readTime;
}

